feat: detect upstream toolchain updates - #239
Conversation
bedffec to
b2aa4f7
Compare
bitwalker
left a comment
There was a problem hiding this comment.
Looks good, but Codex found two issues that check out that we should fix - see comments for details
| let normalized = |component: &Component| { | ||
| let mut component = component.clone(); | ||
| match &mut component.version { | ||
| Authority::Path { last_modification, .. } => *last_modification = None, |
There was a problem hiding this comment.
[P2] Normalize relative path authorities before comparing definitions
Installation rewrites a relative Authority::Path.path using config.working_directory.join(path) in refresh_path_modification_times, but this comparison only removes last_modification. Consequently, an unchanged manifest with "version": {"kind": "path", "path": "src"} shows (update available) in both list and show list immediately after a successful install: the stored absolute path differs from the raw relative path. Running update 0.15.0 --path-update=all succeeds but never clears the marker, because metadata updates preserve the installed authority. This was reproduced against this PR's head. Please account for the install-time path transformation when comparing definitions, while preserving the requirement that listing does not access component sources.
| None if channel | ||
| .migrates_from | ||
| .as_ref() | ||
| .is_some_and(|old| state.get(old).is_some()) => |
There was a problem hiding this comment.
[P2] Honor same-version precedence when displaying migration updates
Checking only whether the predecessor is installed does not match the updater's counterpart-selection rule. If upstream contains both installed 0.15.0 and an uninstalled 0.16.0 declaring migrates_from: "0.15.0", this branch prints 0.16.0 (update available). However, upstream_counterpart_raw prefers the still-published 0.15.0, so update 0.15.0 reports Toolchain 0.15.0 is up to date and performs no migration; show list also reports no update. This was reproduced against this PR's head, and the false marker remains after updating. Please use the same counterpart-selection rule as the updater when deciding whether a successor represents an available update.
This PR adds a warning so the user are notified when the toolchain has changed upstream and needs updating.
midenup show listandmidenup listnow mark an installed toolchain with(update available)if runningmidenup updatewould change it. This replaces the(partially installed)marker, which permanently flagged every default install of 0.15.0+ because it compared against the full channel instead of what the user asked for. Update status is derived on the fly from the upstream manifest.